# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluation do
  @moduledoc """
  A collection of metrics calculated by comparing Model's predictions on all of the test data against annotations from the test data.

  ## Attributes

  *   `annotationSchemaUri` (*type:* `String.t`, *default:* `nil`) - Points to a YAML file stored on Google Cloud Storage describing EvaluatedDataItemView.predictions, EvaluatedDataItemView.ground_truths, EvaluatedAnnotation.predictions, and EvaluatedAnnotation.ground_truths. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). This field is not populated if there are neither EvaluatedDataItemViews nor EvaluatedAnnotations under this ModelEvaluation.
  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this ModelEvaluation was created.
  *   `dataItemSchemaUri` (*type:* `String.t`, *default:* `nil`) - Points to a YAML file stored on Google Cloud Storage describing EvaluatedDataItemView.data_item_payload and EvaluatedAnnotation.data_item_payload. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). This field is not populated if there are neither EvaluatedDataItemViews nor EvaluatedAnnotations under this ModelEvaluation.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - The display name of the ModelEvaluation.
  *   `explanationSpecs` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluationModelEvaluationExplanationSpec.t)`, *default:* `nil`) - Describes the values of ExplanationSpec that are used for explaining the predicted values on the evaluated data.
  *   `metadata` (*type:* `any()`, *default:* `nil`) - The metadata of the ModelEvaluation. For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a structured value with keys of "pipeline_job_id", "evaluation_dataset_type", "evaluation_dataset_path", "row_based_metrics_path".
  *   `metrics` (*type:* `any()`, *default:* `nil`) - Evaluation metrics of the Model. The schema of the metrics is stored in metrics_schema_uri
  *   `metricsSchemaUri` (*type:* `String.t`, *default:* `nil`) - Points to a YAML file stored on Google Cloud Storage describing the metrics of this ModelEvaluation. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
  *   `modelExplanation` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelExplanation.t`, *default:* `nil`) - Aggregated explanation metrics for the Model's prediction output over the data this ModelEvaluation uses. This field is populated only if the Model is evaluated with explanations, and only for AutoML tabular Models. 
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the ModelEvaluation.
  *   `sliceDimensions` (*type:* `list(String.t)`, *default:* `nil`) - All possible dimensions of ModelEvaluationSlices. The dimensions can be used as the filter of the ModelService.ListModelEvaluationSlices request, in the form of `slice.dimension = `.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationSchemaUri => String.t() | nil,
          :createTime => DateTime.t() | nil,
          :dataItemSchemaUri => String.t() | nil,
          :displayName => String.t() | nil,
          :explanationSpecs =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluationModelEvaluationExplanationSpec.t()
            )
            | nil,
          :metadata => any() | nil,
          :metrics => any() | nil,
          :metricsSchemaUri => String.t() | nil,
          :modelExplanation =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelExplanation.t() | nil,
          :name => String.t() | nil,
          :sliceDimensions => list(String.t()) | nil
        }

  field(:annotationSchemaUri)
  field(:createTime, as: DateTime)
  field(:dataItemSchemaUri)
  field(:displayName)

  field(:explanationSpecs,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluationModelEvaluationExplanationSpec,
    type: :list
  )

  field(:metadata)
  field(:metrics)
  field(:metricsSchemaUri)

  field(:modelExplanation,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelExplanation
  )

  field(:name)
  field(:sliceDimensions, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluation do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ModelEvaluation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
